#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <list>
#include <cmath>

using namespace std;

typedef pair<int,int>   ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<vi>     vvi;
typedef vector<vii>    vvii;
typedef map<int,int>    mii;

#define EPS 1e-6

int main(){
    double L,x;
    long long n;
    while(cin >> n,n){
        double lg2 = log(2);
        if(n == 1){
            printf("0 0.00000000\n");
            continue;
        } else if(n < 6){
            L = 1; 
        } else{
            L = floor(log(n) - lg2) + 1;
        }
        x = 1 - n / exp(L);
        printf("%.0lf %.8lf\n",L,x);
    }

    return 0;
}
